<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <!-- 图片切换案例-波仔学习之旅 -->
   <!-- 核心思路分析：
    1.数组存储图片路径->[图片1，图片2，图片3，...]
    2.准备下标index，数组[下标] -> v-bind设置src展示图片 -> 修改下标切换图片 -->
  
    <div id="app">
      <button v-show="index > 0" @click="index--">-</button>
      <img :src="list[index]" alt="">
      <button v-show="index < list.length - 1" @click="index++">+</button>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.16/dist/vue.js"></script>

    <script>
      const app = new Vue({
        el: '#app',
        data: {
          index: 0,
          list: [
            './imgs/11-00.gif',
            './imgs/11-01.gif',
            './imgs/11-02.gif',
            './imgs/11-03.gif',
            './imgs/11-04.png',
            './imgs/11-05.png',
          ]
        }
      })
    </script>
</body>
</html>